package com.tanyin.demo.controller;

import com.tanyin.demo.entity.CommonResult;
import com.tanyin.demo.entity.User;
import com.tanyin.demo.service.LoginService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tanyin
 * @date 2024-05-19
 */
@RestController
public class LoginController {

    @Resource
    LoginService loginService;

    @PostMapping("/user")
    public CommonResult login(@RequestBody User user) {
        return loginService.login(user);
    }
}
